package com.heima.feigns;


import com.heima.feigns.config.HeimaFeignAutoConfiguration;
import com.heima.feigns.fallback.AdminFeignFallback;
import com.heima.model.admin.pojos.AdChannel;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "leadnews-admin",fallbackFactory = AdminFeignFallback.class,
        configuration = HeimaFeignAutoConfiguration.class)
public interface AdminFeign {

    /**
     * 查询敏感词
     * @param
     * @return
     */
    @ApiOperation(value = "查询敏感词")
    @DeleteMapping("/api/v1/sensitive/sensitives")
    public ResponseResult<List<String>> selectAllSensitives();



    /**
     * 根据文章的id查问频道
     * @param id
     * @return
     */
    @ApiOperation("根据id查询频道")
    @GetMapping("/api/v1/channel/one/{id}")
    ResponseResult<AdChannel> findOne(@PathVariable Integer id) ;


    /**
     * 查询频道列表
     * @return
     */
    @GetMapping("/api/v1/channel/channels")
    ResponseResult<List<AdChannel>> findAll();

}
